package com.rtech.app.client;

import org.springframework.web.client.RestTemplate;

public class RestClient {

	RestTemplate restTemplate;

	private static final String REST_SERVICE_URL = "http://localhost:8080/zmeu-blog-spring-rest/location";
	
	/**
	 * Method to get Server direction information via RESTFUL Service.
	 * 
	 */
	public String fetchDirectoryInforViaWS(String dirPath) {
//		String dirPath = "rtech/com";
		String data = restTemplate.getForObject(REST_SERVICE_URL + "/{param}",
				String.class, dirPath);
		
		return data;
	}
	
	/**
	 * Method to get file Information via RESTFUL Service.
	 * 
	 */
	public void fetchFileInforViaWS(String filePath) {
		//String filePath = "rtech/com/myFile.txt";
		String data = restTemplate.getForObject(REST_SERVICE_URL + "/{param}",
				String.class, filePath);
	}

	

}
